package org.xxx.epms.monitor.controller;

import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.xxx.epms.monitor.model.Monitor;
import org.xxx.epms.monitor.service.MonitorService;

@RestController
@RequestMapping("/monitor")
public class MonitorController {

    @Autowired
    private MonitorService monitorService;

    @RequestMapping("/getMonitorInfo")
    public String getMonitorInfo(String monId) {
        return monitorService.getMonitorInfo(monId);
    }

    @ApiModelProperty(value = "通过监督员ID获取监督员", notes = "通过监督员ID获取监督员")
    @RequestMapping(value = "/getMonitorByMonId",method = RequestMethod.GET)
    public Monitor getMonitorByMonId(@RequestParam("monId") String monId) {
        return monitorService.getMonitorByMonId(Integer.parseInt(monId));
    }

    @ApiModelProperty(value = "通过监督员手机号获取监督员", notes = "通过监督员手机号获取监督员")
    @RequestMapping(value = "/getMonitorInfoByTel",method = RequestMethod.GET)
    public Monitor getMonitorInfoByTel(@RequestParam("monTel") String monTel) {
        return monitorService.getMonitorByMonTel(monTel);
    }

}
